const MODIFY_PASSWORD = 'MODIFY_PASSWORD'

// ------------------------------------
// Actions
// ------------------------------------
var counter = 0;
function modifyPassword() {
  counter = counter + 1
  return {
    type: MODIFY_PASSWORD,
    payload: {
      data:[counter]
    }
  }
}

export const navActions = {
  modifyPassword,
}

// ------------------------------------
// Action Handlers
// ------------------------------------
const ACTION_HANDLERS = {
  [MODIFY_PASSWORD]    : (state, action) => ({ ...state, menus: action.payload.data }),
}

// ------------------------------------
// Reducer
// ------------------------------------
const initialState = {
  menus: []
}
export default function (state = initialState, action) {
  const handler = ACTION_HANDLERS[action.type]
  return handler ? handler(state, action) : state
}
